﻿package mortal.game.view.systemSetting.view
{
    import com.mui.containers.*;
    import com.mui.containers.globalVariable.*;
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.game.view.common.*;
    import mortal.game.view.systemSetting.data.*;

    public class SystemSetBigItem extends GSprite
    {
        private var _textField:GTextFiled;
        private var _itemBox:GBox;

        public function SystemSetBigItem()
        {
            return;
        }// end function

        public function updateData(param1:String, param2:Array) : void
        {
            var _loc_5:SystemSetItem = null;
            this.disposeImpl();
            this._textField = UIFactory.textField(param1, 0, 0, 180, 22, this);
            this._itemBox = UICompomentPool.getUICompoment(GBox) as GBox;
            UIFactory.setObjAttri(this._itemBox, 20, 22, -1, -1, this);
            this._itemBox.direction = GBoxDirection.VERTICAL;
            var _loc_3:* = param2.length;
            var _loc_4:int = 0;
            while (_loc_4 < _loc_3)
            {
                
                _loc_5 = UICompomentPool.getUICompoment(SystemSetItem);
                _loc_5.data = param2[_loc_4] as SettingItem;
                this._itemBox.addChild(_loc_5);
                _loc_4++;
            }
            this._itemBox.resetPosition2();
            return;
        }// end function

        public function refreshDisplay() : void
        {
            var _loc_3:SystemSetItem = null;
            var _loc_1:* = this._itemBox.numChildren;
            var _loc_2:* = _loc_1 - 1;
            while (_loc_2 >= 0)
            {
                
                _loc_3 = this._itemBox.getChildAt(_loc_2) as SystemSetItem;
                _loc_3.refreshDisplay();
                _loc_2 = _loc_2 - 1;
            }
            this._itemBox.resetPosition2();
            return;
        }// end function

        override public function get height() : Number
        {
            return 20 + this._itemBox.height;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            if (this._textField)
            {
                this._textField.dispose(param1);
                this._textField = null;
            }
            if (this._itemBox)
            {
                this._itemBox.dispose(param1);
                this._itemBox = null;
            }
            return;
        }// end function

    }
}
